
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>第三节 手写数字识别准确率输出 · Tensorflow学习笔记</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="scottdu">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-katex/katex.min.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-alerts/style.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-donate/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="../chapter4/" />
    
    
    <link rel="prev" href="section3.2.html" />
    

    
    <link rel="stylesheet" href="../gitbook/gitbook-plugin-chart/c3/c3.min.css">
    <script src="../gitbook/gitbook-plugin-chart/c3/d3.min.js"></script>
    <script src="../gitbook/gitbook-plugin-chart/c3/c3.min.js"></script>
    

    <script src="../gitbook/gitbook-plugin-graph/d3.min.js"></script>
    <script src="../gitbook/gitbook-plugin-graph/function-plot.js"></script>    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../chapter1/">
            
                <a href="../chapter1/">
            
                    
                    第一章 Tensorflow框架
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../chapter1/section1.1.html">
            
                <a href="../chapter1/section1.1.html">
            
                    
                    第一节 张量、计算图、会话
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../chapter1/section1.2.html">
            
                <a href="../chapter1/section1.2.html">
            
                    
                    第二节 前向传播
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../chapter1/section1.3.html">
            
                <a href="../chapter1/section1.3.html">
            
                    
                    第三节 反向传播
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="../chapter1/section1.4.html">
            
                <a href="../chapter1/section1.4.html">
            
                    
                    第四节 搭建神经网络的步骤
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../chapter2/">
            
                <a href="../chapter2/">
            
                    
                    第二章 神经网络优化
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../chapter2/section2.1.html">
            
                <a href="../chapter2/section2.1.html">
            
                    
                    第一节 损失函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../chapter2/section2.2.html">
            
                <a href="../chapter2/section2.2.html">
            
                    
                    第二节 学习率
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../chapter2/section2.3.html">
            
                <a href="../chapter2/section2.3.html">
            
                    
                    第三节 滑动平均
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../chapter2/section2.4.html">
            
                <a href="../chapter2/section2.4.html">
            
                    
                    第四节 正则化
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="../chapter2/section2.5.html">
            
                <a href="../chapter2/section2.5.html">
            
                    
                    第五节 神经网络的搭建
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="./">
            
                <a href="./">
            
                    
                    第三章 全连接网络基础
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="section3.1.html">
            
                <a href="section3.1.html">
            
                    
                    第一节 MINIST数据
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="section3.2.html">
            
                <a href="section3.2.html">
            
                    
                    第二节 模块化搭建神经网络方法
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.4.3" data-path="section3.3.html">
            
                <a href="section3.3.html">
            
                    
                    第三节 手写数字识别准确率输出
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../chapter4/">
            
                <a href="../chapter4/">
            
                    
                    第四章 全连接网络实践
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../chapter4/section4.1.html">
            
                <a href="../chapter4/section4.1.html">
            
                    
                    第一节 输入手写数字图片输出识别结果
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../chapter4/section4.2.html">
            
                <a href="../chapter4/section4.2.html">
            
                    
                    第二节 制作数据集
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../chapter5/">
            
                <a href="../chapter5/">
            
                    
                    第五章 卷积网络基础
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../chapter5/section5.1.html">
            
                <a href="../chapter5/section5.1.html">
            
                    
                    第一节 卷积神经网络
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../chapter5/section5.2.html">
            
                <a href="../chapter5/section5.2.html">
            
                    
                    第二节 lenel5代码讲解
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../chapter6/">
            
                <a href="../chapter6/">
            
                    
                    第六章 卷积网络实践
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../chapter5/section6.1.html">
            
                <a href="../chapter5/section6.1.html">
            
                    
                    第一节 复现已有的卷积神经网络
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../chapter6/section6.2.html">
            
                <a href="../chapter6/section6.2.html">
            
                    
                    第二节 用vgg16实现图片识别
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../chapter7/">
            
                <a href="../chapter7/">
            
                    
                    第七章 Tensorflow应用
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >第三节 手写数字识别准确率输出</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x7B2C;&#x4E09;&#x8282;-&#x624B;&#x5199;&#x6570;&#x5B57;&#x8BC6;&#x522B;&#x51C6;&#x786E;&#x7387;&#x8F93;&#x51FA;">&#x7B2C;&#x4E09;&#x8282; &#x624B;&#x5199;&#x6570;&#x5B57;&#x8BC6;&#x522B;&#x51C6;&#x786E;&#x7387;&#x8F93;&#x51FA;</h1>
<p>&#x5B9E;&#x73B0;&#x624B;&#x5199;&#x4F53;<code>mnist</code>&#x6570;&#x636E;&#x96C6;&#x7684;&#x8BC6;&#x522B;&#x4EFB;&#x52A1;&#xFF0C;&#x5171;&#x5206;&#x4E3A;&#x4E09;&#x4E2A;&#x6A21;&#x5757;&#x6587;&#x4EF6;&#xFF0C;&#x5206;&#x522B;&#x662F;&#x63CF;&#x8FF0;&#x7F51;&#x7EDC;&#x7ED3;&#x6784;&#x7684;&#x524D;&#x5411;&#x4F20;&#x64AD;&#x8FC7;&#x7A0B;&#x6587;&#x4EF6;(mnist_forward.py)&#x3001;&#x63CF;&#x8FF0;&#x7F51;&#x7EDC;&#x53C2;&#x6570;&#x4F18;&#x5316;&#x65B9;&#x6CD5;&#x7684;&#x53CD;&#x5411;&#x4F20;&#x64AD;&#x8FC7;&#x7A0B;&#x6587;&#x4EF6;(mnist_backward.py)&#x3001;&#x9A8C;&#x8BC1;&#x6A21;&#x578B;&#x51C6;&#x786E;&#x7387;&#x7684;&#x6D4B;&#x8BD5;&#x8FC7;&#x7A0B;&#x6587;&#x4EF6; (mnist_test.py)&#x3002;</p>
<ul>
<li>&#x524D;&#x5411;&#x4F20;&#x64AD;&#x8FC7;&#x7A0B;&#x6587;&#x4EF6;(mnist_forward.py)</li>
</ul>
<p>&#x5728;&#x524D;&#x5411;&#x4F20;&#x64AD;&#x8FC7;&#x7A0B;&#x4E2D;&#xFF0C;&#x9700;&#x8981;&#x5B9A;&#x4E49;&#x7F51;&#x7EDC;&#x6A21;&#x578B;&#x8F93;&#x5165;&#x5C42;&#x4E2A;&#x6570;&#x3001;&#x9690;&#x85CF;&#x5C42;&#x8282;&#x70B9;&#x6570;&#x3001;&#x8F93;&#x51FA;&#x5C42;&#x4E2A;&#x6570;&#xFF0C;&#x5B9A;&#x4E49;&#x7F51;&#x7EDC;&#x53C2;&#x6570;<code>w</code>&#x3001;&#x504F;&#x7F6E;<code>b</code>&#xFF0C;&#x5B9A;&#x4E49;&#x7531;&#x8F93;&#x5165;&#x5230;&#x8F93;&#x51FA;&#x7684;&#x795E;&#x7ECF;&#x7F51;&#x7EDC;&#x67B6;&#x6784;&#x3002;</p>
<p>&#x5B9E;&#x73B0;&#x624B;&#x5199;&#x4F53;<code>mnist</code>&#x6570;&#x636E;&#x96C6;&#x7684;&#x8BC6;&#x522B;&#x4EFB;&#x52A1;&#x524D;&#x5411;&#x4F20;&#x64AD;&#x8FC7;&#x7A0B;&#x5982;&#x4E0B;:</p>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

INPUT_NODE = <span class="hljs-number">784</span>
OUTPUT_NODE = <span class="hljs-number">10</span>
LAYER1_NODE = <span class="hljs-number">500</span>

<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">get_weight</span><span class="hljs-params">(shape, regularizer)</span>:</span>
  w = tf.Variable(tf.truncated_normal(shape,stddev=<span class="hljs-number">0.1</span>))
  <span class="hljs-keyword">if</span> regularizer != <span class="hljs-keyword">None</span>:
    tf.add_to_collection(<span class="hljs-string">&apos;losses&apos;</span>, tf.contrib.layers.l2_regularizer(regularizer)(w))
  <span class="hljs-keyword">return</span> w

<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">get_bias</span><span class="hljs-params">(shape)</span>:</span>
  b = tf.Variable(tf.zeros(shape))
  <span class="hljs-keyword">return</span> b

<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">forward</span><span class="hljs-params">(x, regularizer)</span>:</span>
  w1 = get_weight([INPUT_NODE, LAYER1_NODE], regularizer)
  b1 = get_bias([LAYER1_NODE])
  Y1 = tf.nn.relu(tf.matmul(x, w1) + b1)

  w2 = get_weight([LAYER1_NODE, OUTPUT_NODE], regularizer)
  b2 = get_bias([OUTPUT_NODE])
  y = tf.matmul(y1, w2) + b2
  <span class="hljs-keyword">return</span> y
</code></pre>
<p>&#x7531;&#x4E0A;&#x8FF0;&#x4EE3;&#x7801;&#x53EF;&#x77E5;&#xFF0C;&#x5728;&#x524D;&#x5411;&#x4F20;&#x64AD;&#x8FC7;&#x7A0B;&#x4E2D;&#xFF0C;&#x89C4;&#x5B9A;&#x7F51;&#x7EDC;&#x8F93;&#x5165;&#x7ED3;&#x70B9;&#x4E3A;784&#x4E2A;(&#x4EE3;&#x8868;&#x6BCF;&#x5F20;&#x8F93;&#x5165;&#x56FE;&#x7247;&#x7684;&#x50CF;&#x7D20;&#x4E2A;&#x6570;)&#xFF0C;&#x9690;&#x85CF;&#x5C42;&#x8282;&#x70B9;500&#x4E2A;&#xFF0C;&#x8F93;&#x51FA;&#x8282;&#x70B9;10&#x4E2A;(&#x8868;&#x793A;&#x8F93;&#x51FA;&#x4E3A;&#x6570;&#x5B57;0-9&#x7684;&#x5341;&#x5206;&#x7C7B;)&#x3002;&#x7531;&#x8F93;&#x5165;&#x5C42;&#x5230;&#x9690;&#x85CF;&#x5C42;&#x7684;&#x53C2;&#x6570;<code>w1</code>&#x5F62;&#x72B6;&#x4E3A;<code>[784,500]</code>&#xFF0C;&#x7531;&#x9690;&#x85CF;&#x5C42;&#x5230;&#x8F93;&#x51FA;&#x5C42;&#x7684;&#x53C2;&#x6570;<code>w2</code>&#x5F62;&#x72B6;&#x4E3A;<code>[500,10]</code>&#xFF0C;&#x53C2;&#x6570;&#x6EE1;&#x8DB3;&#x622A;&#x65AD;&#x6B63;&#x6001;&#x5206;&#x5E03;&#xFF0C;&#x5E76;&#x4F7F;&#x7528;&#x6B63;&#x5219;&#x5316;&#xFF0C;&#x5C06;&#x6BCF;&#x4E2A;&#x53C2;&#x6570;&#x7684;&#x6B63;&#x5219;&#x5316;&#x635F;&#x5931;&#x52A0;&#x5230;&#x603B;&#x635F;&#x5931;&#x4E2D;&#x3002;&#x7531;&#x8F93;&#x5165;&#x5C42;&#x5230;&#x9690;&#x85CF;&#x5C42;&#x7684;&#x504F;&#x7F6E;<code>b1</code>&#x5F62;&#x72B6;&#x4E3A;&#x957F;&#x5EA6;&#x4E3A;500&#x7684;&#x4E00;&#x7EF4;&#x6570;&#x7EC4;&#xFF0C;&#x7531;&#x9690;&#x85CF;&#x5C42;&#x5230;&#x8F93;&#x51FA;&#x5C42;&#x7684;&#x504F;&#x7F6E;<code>b2</code>&#x5F62;&#x72B6;&#x4E3A;&#x957F;&#x5EA6;&#x4E3A;10&#x7684;&#x4E00;&#x7EF4;&#x6570;&#x7EC4;&#xFF0C;&#x521D;&#x59CB;&#x5316;&#x503C;&#x4E3A;&#x5168;0&#x3002;&#x524D;&#x5411;&#x4F20;&#x64AD;&#x7ED3;&#x6784;&#x7B2C;&#x4E00;&#x5C42;&#x4E3A;&#x8F93;&#x5165;<code>x</code>&#x4E0E;&#x53C2;&#x6570;<code>w1</code>&#x77E9;&#x9635;&#x76F8;&#x4E58;&#x52A0;&#x4E0A;&#x504F;&#x7F6E;<code>b1</code>&#xFF0C;&#x518D;&#x7ECF;&#x8FC7;<code>relu</code>&#x51FD;&#x6570;&#xFF0C;&#x5F97;&#x5230;&#x9690;&#x85CF;&#x5C42;&#x8F93;&#x51FA;<code>y1</code>&#x3002;&#x524D;&#x5411;&#x4F20;&#x64AD;&#x7ED3;&#x6784;&#x7B2C;&#x4E8C;&#x5C42;&#x4E3A;&#x9690;&#x85CF;&#x5C42;&#x8F93;&#x51FA;<code>y1</code>&#x4E0E;&#x53C2;&#x6570;<code>w2</code>&#x77E9;&#x9635;&#x76F8;&#x4E58;&#x52A0;&#x4E0A;&#x504F;&#x7F6E;<code>b2</code>&#xFF0C;&#x5F97;&#x5230;&#x8F93;&#x51FA;<code>y</code>&#x3002;&#x7531;&#x4E8E;&#x8F93;&#x51FA;<code>y</code>&#x8981;&#x7ECF;&#x8FC7; <code>softmax</code>&#x51FD;&#x6570;&#xFF0C;&#x4F7F;&#x5176;&#x7B26;&#x5408;&#x6982;&#x7387;&#x5206;&#x5E03;&#xFF0C;&#x6545;&#x8F93;&#x51FA;<code>y</code>&#x4E0D;&#x7ECF;&#x8FC7;<code>relu</code>&#x51FD;&#x6570;&#x3002;</p>
<ul>
<li>&#x53CD;&#x5411;&#x4F20;&#x64AD;&#x8FC7;&#x7A0B;&#x6587;&#x4EF6;(mnist_backward.py)</li>
</ul>
<p>&#x53CD;&#x5411;&#x4F20;&#x64AD;&#x8FC7;&#x7A0B;&#x5B9E;&#x73B0;&#x5229;&#x7528;&#x8BAD;&#x7EC3;&#x6570;&#x636E;&#x96C6;&#x5BF9;&#x795E;&#x7ECF;&#x7F51;&#x7EDC;&#x6A21;&#x578B;&#x8BAD;&#x7EC3;&#xFF0C;&#x901A;&#x8FC7;&#x964D;&#x4F4E;&#x635F;&#x5931;&#x51FD;&#x6570;&#x503C;&#xFF0C;&#x5B9E;&#x73B0;&#x7F51;&#x7EDC;&#x6A21;&#x578B;&#x53C2;&#x6570;&#x7684;&#x4F18;&#x5316;&#xFF0C;&#x4ECE;&#x800C;&#x5F97;&#x5230;&#x51C6;&#x786E;&#x7387;&#x9AD8;&#x4E14;&#x6CDB;&#x5316;&#x80FD;&#x529B;&#x5F3A;&#x7684;&#x795E;&#x7ECF;&#x7F51;&#x7EDC;&#x6A21;&#x578B;&#x3002;&#x5B9E;&#x73B0;&#x624B;&#x5199;&#x4F53;<code>mnist</code>&#x6570;&#x636E;&#x96C6;&#x7684;&#x8BC6;&#x522B;&#x4EFB;&#x52A1;&#x53CD;&#x5411;&#x4F20;&#x64AD;&#x8FC7;&#x7A0B;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf
<span class="hljs-keyword">from</span> tensorflow.examples.tutorials.mnist <span class="hljs-keyword">import</span> input_data
<span class="hljs-keyword">import</span> mnist_forward
<span class="hljs-keyword">import</span> os

BATCH_SIZE = <span class="hljs-number">200</span>
LEARNING_RATE_BASE = <span class="hljs-number">0.1</span>
LEARNING_RATE_DECAY = <span class="hljs-number">0.99</span>
REGULARIZER = <span class="hljs-number">0.0001</span>
STEPS = <span class="hljs-number">50000</span>
MOVING_AVERAGE_DECAY = <span class="hljs-number">0.99</span>
MODEL_SAVE_PATH = <span class="hljs-string">&apos;./model/&apos;</span>
MODEL_NAME = <span class="hljs-string">&apos;mnist_model&apos;</span>

<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">backward</span><span class="hljs-params">(mnist)</span>:</span>
  x = tf.placeholder(tf.float32, [<span class="hljs-keyword">None</span>, mnist_forward.INPUT_NODE])
  Y_ = tf.placeholder(tf.float32, [<span class="hljs-keyword">None</span>, mnist_forward.OUTPUT_NODE])
  y = mnist_forard.forward(x, REGULARIZER)
  global_step = tf.Variable(<span class="hljs-number">0</span>, trainable=<span class="hljs-keyword">False</span>)

  ce = tf.nn.sparse_softmax_cross_entropy_with_logits(logits=y, labels=tf.argmax(y_,<span class="hljs-number">1</span>))
  cem = tf.reduce_mean(ce)
  loss = cem + tf.add_n(tf.get_collection(<span class="hljs-string">&apos;losses&apos;</span>))

  learning_rate = tf.train.exponential_decay(LEARNING_RATE_BASE, global_step, mnist.train.num_examples/BATCH_SIZE, LEARNING_RATE_DECAY, staircase=<span class="hljs-keyword">True</span>)
  train_step = tf.train.GradientDescentOptimizer(learning_rate).minimize(loss, global_step=global_step)

  ema = tf.train.ExponentialMovingAverage(MOVING_AVERAGE_DECAY, global_step)
  ema_op = ema.apply(tf.trainable_variables())
  <span class="hljs-keyword">with</span> tf.control_dependencies([train_step, ema_op]):
    train_op = tf.no_op(name=<span class="hljs-string">&apos;train&apos;</span>)

  saver = tf.train.Saver()

  <span class="hljs-keyword">with</span> tf.Session() <span class="hljs-keyword">as</span> sess:
    init_op = tf.global_variables_initializer()
    sess.run(init_op)

    <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> range(STEPS):
      xs, ys = mnist.train.next_batch(BATCH_SIZE)
      _, loss_value, step = sess.run([train_op, loss, global_step], feed_dict={x: xs, y_: ys})
      <span class="hljs-keyword">if</span> i % <span class="hljs-number">1000</span> == <span class="hljs-number">0</span>:
        print(<span class="hljs-string">&quot;After %d training step(s), loss on training batch is %g.&quot;</span> % (step, loss_value))
        saver.save(sess, os.path.join(MODEL_SAVE_PATH, MODEL_NAME), global_step=global_step)

<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">main</span><span class="hljs-params">()</span>:</span>
  mnist = input_data.read_data_sets(<span class="hljs-string">&quot;./data/&quot;</span>, one_hot=<span class="hljs-keyword">True</span>)
  backward(mnist)

<span class="hljs-keyword">if</span> __name__ == <span class="hljs-string">&apos;__main__&apos;</span>:
  main()
</code></pre>
<p>&#x7531;&#x4E0A;&#x8FF0;&#x4EE3;&#x7801;&#x53EF;&#x77E5;&#xFF0C;&#x5728;&#x53CD;&#x5411;&#x4F20;&#x64AD;&#x8FC7;&#x7A0B;&#x4E2D;&#xFF0C;&#x9996;&#x5148;&#x5F15;&#x5165;<code>tensorflow</code>&#x3001;<code>input_data</code>&#x3001;&#x524D;&#x5411;&#x4F20;&#x64AD;<code>mnist_forward</code>&#x548C;<code>os</code>&#x6A21;&#x5757;&#xFF0C;&#x5B9A;&#x4E49;&#x6BCF;&#x8F6E;&#x5582;&#x5165;&#x795E;&#x7ECF;&#x7F51;&#x7EDC;&#x7684;&#x56FE;&#x7247;&#x6570;&#x3001;&#x521D;&#x59CB;&#x5B66;&#x4E60;&#x7387;&#x3001;&#x5B66;&#x4E60;&#x7387;&#x8870;&#x51CF;&#x7387;&#x3001;&#x6B63;&#x5219;&#x5316;&#x7CFB;&#x6570;&#x3001;&#x8BAD;&#x7EC3;&#x8F6E;&#x6570;&#x3001;&#x6A21;&#x578B;&#x4FDD;&#x5B58;&#x8DEF;&#x5F84;&#x4EE5;&#x53CA;&#x6A21;&#x578B;&#x4FDD;&#x5B58;&#x540D;&#x79F0;&#x7B49;&#x76F8;&#x5173;&#x4FE1;&#x606F;&#x3002;&#x5728;&#x53CD;&#x5411;&#x4F20;&#x64AD;&#x51FD;&#x6570;<code>backword</code>&#x4E2D;&#xFF0C;&#x9996;&#x5148;&#x8BFB;&#x5165;<code>mnist</code>&#xFF0C;&#x7528; <code>placeholder</code>&#x7ED9;&#x8BAD;&#x7EC3;&#x6570;&#x636E;<code>x</code>&#x548C;&#x6807;&#x7B7E;<code>y_</code>&#x5360;&#x4F4D;&#xFF0C;&#x8C03;&#x7528;<code>mnist_forward</code>&#x6587;&#x4EF6;&#x4E2D;&#x7684;&#x524D;&#x5411;&#x4F20;&#x64AD;&#x8FC7;&#x7A0B;<code>forword()</code>&#x51FD;&#x6570;&#xFF0C;&#x5E76;&#x8BBE;&#x7F6E;&#x6B63;&#x5219;&#x5316;&#xFF0C;&#x8BA1;&#x7B97;&#x8BAD;&#x7EC3;&#x6570;&#x636E;&#x96C6;&#x4E0A;&#x7684;&#x9884;&#x6D4B;&#x7ED3;&#x679C;<code>y</code>&#xFF0C;&#x5E76;&#x7ED9;&#x5F53;&#x524D;&#x8BA1;&#x7B97;&#x8F6E;&#x6570;&#x8BA1;&#x6570;&#x5668;&#x8D4B;&#x503C;&#xFF0C;&#x8BBE;&#x5B9A;&#x4E3A;&#x4E0D;&#x53EF;&#x8BAD;&#x7EC3;&#x7C7B;&#x578B;&#x3002;&#x63A5;&#x7740;&#xFF0C;&#x8C03;&#x7528;&#x5305;&#x542B;&#x6240;&#x6709;&#x53C2;&#x6570;&#x6B63;&#x5219;&#x5316;&#x635F;&#x5931;&#x7684;&#x635F;&#x5931;&#x51FD;&#x6570;<code>loss</code>&#xFF0C;&#x5E76;&#x8BBE;&#x5B9A;&#x6307;&#x6570;&#x8870;&#x51CF;&#x5B66;&#x4E60;&#x7387;<code>learning_rate</code>&#x3002;&#x7136;&#x540E;&#xFF0C;&#x4F7F;&#x7528;&#x68AF;&#x5EA6;&#x8870;&#x51CF;&#x7B97;&#x6CD5;&#x5BF9;&#x6A21;&#x578B;&#x4F18;&#x5316;&#xFF0C;&#x964D;&#x4F4E;&#x635F;&#x5931;&#x51FD;&#x6570;&#xFF0C;&#x5E76;&#x5B9A;&#x4E49;&#x53C2;&#x6570;&#x7684;&#x6ED1;&#x52A8;&#x5E73;&#x5747;&#x3002;&#x6700;&#x540E;&#xFF0C;&#x5728;<code>with</code>&#x7ED3;&#x6784;&#x4E2D;&#xFF0C;&#x5B9E;&#x73B0;&#x6240; &#x6709;&#x53C2;&#x6570;&#x521D;&#x59CB;&#x5316;&#xFF0C;&#x6BCF;&#x6B21;&#x5582;&#x5165;<code>batch_size</code>&#x7EC4;(&#x5373;200&#x7EC4;)&#x8BAD;&#x7EC3;&#x6570;&#x636E;&#x548C;&#x5BF9;&#x5E94;&#x6807;&#x7B7E;&#xFF0C;&#x5FAA;&#x73AF;&#x8FED;&#x4EE3; <code>steps</code>&#x8F6E;&#xFF0C;&#x5E76;&#x6BCF;&#x9694;1000&#x8F6E;&#x6253;&#x5370;&#x51FA;&#x4E00;&#x6B21;&#x635F;&#x5931;&#x51FD;&#x6570;&#x503C;&#x4FE1;&#x606F;&#xFF0C;&#x5E76;&#x5C06;&#x5F53;&#x524D;&#x4F1A;&#x8BDD;&#x52A0;&#x8F7D;&#x5230;&#x6307;&#x5B9A;&#x8DEF;&#x5F84;&#x3002;&#x6700;&#x540E;&#xFF0C;&#x901A;&#x8FC7;&#x4E3B;&#x51FD;&#x6570;<code>main()</code>&#xFF0C;&#x52A0;&#x8F7D;&#x6307;&#x5B9A;&#x8DEF;&#x5F84;&#x4E0B;&#x7684;&#x8BAD;&#x7EC3;&#x6570;&#x636E;&#x96C6;&#xFF0C;&#x5E76;&#x8C03;&#x7528;&#x89C4;&#x5B9A;&#x7684;<code>backward()</code>&#x51FD;&#x6570;&#x8BAD;&#x7EC3;&#x6A21;&#x578B;&#x3002;</p>
<ul>
<li>&#x6D4B;&#x8BD5;&#x8FC7;&#x7A0B;&#x6587;&#x4EF6;(mnist_test.py)</li>
</ul>
<p>&#x5F53;&#x8BAD;&#x7EC3;&#x5B8C;&#x6A21;&#x578B;&#x540E;&#xFF0C;&#x7ED9;&#x795E;&#x7ECF;&#x7F51;&#x7EDC;&#x6A21;&#x578B;&#x8F93;&#x5165;&#x6D4B;&#x8BD5;&#x96C6;&#x9A8C;&#x8BC1;&#x7F51;&#x7EDC;&#x7684;&#x51C6;&#x786E;&#x6027;&#x548C;&#x6CDB;&#x5316;&#x6027;&#x3002;&#x6CE8;&#x610F;&#xFF0C;&#x6240;&#x7528;&#x7684;&#x6D4B;&#x8BD5;&#x96C6;&#x548C;&#x8BAD;&#x7EC3;&#x96C6;&#x662F;&#x76F8;&#x4E92;&#x72EC;&#x7ACB;&#x7684;&#x3002;&#x5B9E;&#x73B0;&#x624B;&#x5199;&#x4F53;<code>mnist</code>&#x6570;&#x636E;&#x96C6;&#x7684;&#x8BC6;&#x522B;&#x4EFB;&#x52A1;&#x6D4B;&#x8BD5;&#x4F20;&#x64AD;&#x8FC7;&#x7A0B;&#x5982;&#x4E0B;:</p>
<pre><code class="lang-python"><span class="hljs-comment">#encoding:utf-8</span>
<span class="hljs-keyword">import</span> time
<span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf
<span class="hljs-keyword">from</span> tensorflow.examples.tutorials.mnist <span class="hljs-keyword">import</span> input_data
<span class="hljs-keyword">import</span> mnist_forward
<span class="hljs-keyword">import</span> mnist_backward
TEST_INTERVAL_SECS = <span class="hljs-number">5</span>

<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">test</span><span class="hljs-params">(mnist)</span>:</span>
  <span class="hljs-keyword">with</span> tf.Graph().as_default() <span class="hljs-keyword">as</span> g:
    x = tf.placeholder(tf.float32, [<span class="hljs-keyword">None</span>, mnist_forward.INPUT_NODE])
    y_ = tf.placeholder(tf.float32, [<span class="hljs-keyword">None</span>, mnist_forward.OUTPUT_NODE])
    y = mnist_forward.forward(x, <span class="hljs-keyword">None</span>)

    ema = tf.train.ExponentialMovingAverage(mnist_backward.MOVING_AVERAGE_DECAY)
    ema_restore = ema.variables_to_restore()
    saver = tf.train.Saver(ema_restore)

    correct_prediction = tf.equal(tf.argmax(y, <span class="hljs-number">1</span>), tf.argmax(y_, <span class="hljs-number">1</span>))
    accuracy = tf.reduce_mean(tf.cast(correct_prediction, tf.float32))

    <span class="hljs-keyword">while</span> <span class="hljs-keyword">True</span>:
      <span class="hljs-keyword">with</span> tf.Session() <span class="hljs-keyword">as</span> sess:
        ckpt = tf.train.get_checkpoint_state(mnist_backward.MODEL_SAVE_PATH)
        <span class="hljs-keyword">if</span> ckpt <span class="hljs-keyword">and</span> ckpt.model_checkpoint_path:
          saver.restore(sess, ckpt.model_checkpoint_path)
          global_step = ckpt.model_checkpoint_path.split(<span class="hljs-string">&apos;/&apos;</span>)[<span class="hljs-number">-1</span>].split(<span class="hljs-string">&apos;-&apos;</span>)[<span class="hljs-number">-1</span>]
          accuracy_score = sess.run(accuracy, feed_dict={x: mnist.test.images, y_: mnist.test.labels})
          print(<span class="hljs-string">&quot;After %s training step(s), test accuracy = %g&quot;</span> % (global_step, accuracy_score))
        <span class="hljs-keyword">else</span>:
          print(<span class="hljs-string">&quot;No checkpoint file found&quot;</span>)
          <span class="hljs-keyword">return</span>
      time.sleep(TEST_INTERVAL_SECS)

<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">main</span><span class="hljs-params">()</span>:</span>
  mnist = input_data.read_data_sets(<span class="hljs-string">&quot;./data/&quot;</span>, one_hot=<span class="hljs-keyword">True</span>)
  test(mnist)

<span class="hljs-keyword">if</span> __name__ == <span class="hljs-string">&apos;__main__&apos;</span>:
  main()
</code></pre>
<p>&#x5728;&#x4E0A;&#x8FF0;&#x4EE3;&#x7801;&#x4E2D;&#xFF0C;&#x9996;&#x5148;&#x9700;&#x8981;&#x5F15;&#x5165;<code>time</code>&#x6A21;&#x5757;&#x3001;<code>tensorflow</code>&#x3001;<code>input_data</code>&#x3001;&#x524D;&#x5411;&#x4F20;&#x64AD;<code>mnist_forward</code>&#x3001;&#x53CD;&#x5411;&#x4F20;&#x64AD;<code>mnist_backward</code>&#x6A21;&#x5757;&#x548C;<code>os</code>&#x6A21;&#x5757;&#xFF0C;&#x5E76;&#x89C4;&#x5B9A;&#x7A0B;&#x5E8F;5&#x79D2;&#x7684;&#x5FAA;&#x73AF;&#x95F4;&#x9694;&#x65F6;&#x95F4;&#x3002;&#x63A5;&#x7740;&#xFF0C;&#x5B9A;&#x4E49;&#x6D4B;&#x8BD5;&#x51FD;&#x6570;<code>test()</code>,&#x8BFB;&#x5165;<code>mnist</code>&#x6570;&#x636E;&#x96C6;&#xFF0C;&#x5229;&#x7528; <code>tf.Graph()</code>&#x590D;&#x73B0;&#x4E4B;&#x524D;&#x5B9A;&#x4E49;&#x7684;&#x8BA1;&#x7B97;&#x56FE;&#xFF0C;&#x5229;&#x7528;<code>placeholder</code>&#x7ED9;&#x8BAD;&#x7EC3;&#x6570;&#x636E;<code>x</code>&#x548C;&#x6807;&#x7B7E;<code>y_</code>&#x5360;&#x4F4D;&#xFF0C;&#x8C03;&#x7528;<code>mnist_forward</code>&#x6587;&#x4EF6;&#x4E2D;&#x7684;&#x524D;&#x5411;&#x4F20;&#x64AD;&#x8FC7;&#x7A0B;<code>forword()</code>&#x51FD;&#x6570;&#xFF0C;&#x8BA1;&#x7B97;&#x8BAD;&#x7EC3;&#x6570;&#x636E;&#x96C6;&#x4E0A;&#x7684;&#x9884;&#x6D4B;&#x7ED3;&#x679C;<code>y</code>&#x3002;&#x63A5;&#x7740;&#xFF0C;&#x5B9E;&#x4F8B;&#x5316;&#x5177;&#x6709;&#x6ED1;&#x52A8;&#x5E73;&#x5747;&#x7684;<code>saver</code>&#x5BF9;&#x8C61;&#xFF0C;&#x4ECE;&#x800C;&#x5728;&#x4F1A;&#x8BDD;&#x88AB;&#x52A0;&#x8F7D;&#x65F6;&#x6A21;&#x578B;&#x4E2D;&#x7684;&#x6240;&#x6709;&#x53C2;&#x6570;&#x88AB;&#x8D4B;&#x503C;&#x4E3A;&#x5404;&#x81EA;&#x7684;&#x6ED1;&#x52A8;&#x5E73;&#x5747;&#x503C;&#xFF0C;&#x589E;&#x5F3A;&#x6A21;&#x578B;&#x7684;&#x7A33;&#x5B9A;&#x6027;&#xFF0C;&#x7136;&#x540E;&#x8BA1;&#x7B97;&#x6A21;&#x578B;&#x5728;&#x6D4B;&#x8BD5;&#x96C6;&#x4E0A;&#x7684;&#x51C6;&#x786E;&#x7387;&#x3002;&#x5728;<code>with</code>&#x7ED3;&#x6784;&#x4E2D;&#xFF0C;&#x52A0;&#x8F7D;&#x6307;&#x5B9A;&#x8DEF;&#x5F84;&#x4E0B;&#x7684;<code>ckpt</code>&#xFF0C;&#x82E5;&#x6A21;&#x578B;&#x5B58;&#x5728;&#xFF0C;&#x5219;&#x52A0;&#x8F7D;&#x51FA;&#x6A21;&#x578B;&#x5230;&#x5F53;&#x524D;&#x5BF9;&#x8BDD;&#xFF0C;&#x5728;&#x6D4B;&#x8BD5;&#x6570;&#x636E;&#x96C6;&#x4E0A;&#x8FDB;&#x884C;&#x51C6;&#x786E;&#x7387;&#x9A8C;&#x8BC1;&#xFF0C;&#x5E76;&#x6253;&#x5370;&#x51FA;&#x5F53;&#x524D;&#x8F6E;&#x6570;&#x4E0B;&#x7684;&#x51C6;&#x786E;&#x7387;&#xFF0C;&#x82E5;&#x6A21;&#x578B;&#x4E0D;&#x5B58;&#x5728;&#xFF0C;&#x5219;&#x6253;&#x5370;&#x51FA;&#x6A21;&#x578B;&#x4E0D;&#x5B58;&#x5728;&#x7684;&#x63D0;&#x793A;&#xFF0C;&#x4ECE;&#x800C;<code>test()</code>&#x51FD;&#x6570;&#x5B8C;&#x6210;&#x3002; &#x901A;&#x8FC7;&#x4E3B;&#x51FD;&#x6570;<code>main()</code>&#xFF0C;&#x52A0;&#x8F7D;&#x6307;&#x5B9A;&#x8DEF;&#x5F84;&#x4E0B;&#x7684;&#x6D4B;&#x8BD5;&#x6570;&#x636E;&#x96C6;&#xFF0C;&#x5E76;&#x8C03;&#x7528;&#x89C4;&#x5B9A;&#x7684;<code>test</code>&#x51FD;&#x6570;&#xFF0C;&#x8FDB;&#x884C;&#x6A21;&#x578B;&#x5728;&#x6D4B;&#x8BD5;&#x96C6;&#x4E0A;&#x7684;&#x51C6;&#x786E;&#x7387;&#x9A8C;&#x8BC1;&#x3002;</p>
<p>&#x8FD0;&#x884C;&#x4EE5;&#x4E0A;&#x4E09;&#x4E2A;&#x6587;&#x4EF6;&#xFF0C;&#x53EF;&#x5F97;&#x5230;&#x624B;&#x5199;&#x4F53;<code>mnist</code>&#x6570;&#x636E;&#x96C6;&#x7684;&#x8BC6;&#x522B;&#x4EFB;&#x52A1;&#x7684;&#x8FD0;&#x884C;&#x7ED3;&#x679C;:</p>
<p><img src="http://ovhbzkbox.bkt.clouddn.com/2018-08-14-15341764460195.jpg" alt=""></p>
<p>&#x4ECE;&#x7EC8;&#x7AEF;&#x663E;&#x793A;&#x7684;&#x8FD0;&#x884C;&#x7ED3;&#x679C;&#x53EF;&#x4EE5;&#x770B;&#x51FA;&#xFF0C;&#x968F;&#x7740;&#x8BAD;&#x7EC3;&#x8F6E;&#x6570;&#x7684;&#x589E;&#x52A0;&#xFF0C;&#x7F51;&#x7EDC;&#x6A21;&#x578B;&#x7684;&#x635F;&#x5931;&#x51FD;&#x6570;&#x503C;&#x5728;&#x4E0D;&#x65AD;&#x964D;&#x4F4E;&#xFF0C;&#x5E76;&#x4E14;&#x5728;&#x6D4B;&#x8BD5;&#x96C6;&#x4E0A;&#x7684;&#x51C6;&#x786E;&#x7387;&#x5728;&#x4E0D;&#x65AD;&#x63D0;&#x5347;&#xFF0C;&#x6709;&#x8F83;&#x597D;&#x7684;&#x6CDB;&#x5316;&#x80FD;&#x529B;&#x3002;</p>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; scottdu 2018 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x8BE5;&#x6587;&#x4EF6;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2018-08-18 15:53:44
</span></footer> <link rel="stylesheet" type="text/css" href="https://storage.googleapis.com/app.klipse.tech/css/codemirror.css"> <script>     window.klipse_settings = {         selector: ".language-klipse, .lang-eval-clojure",         selector_eval_js: ".lang-eval-js",         selector_eval_python_client: ".lang-eval-python",         selector_eval_php: ".lang-eval-php",         selector_eval_scheme: ".lang-eval-scheme",         selector_eval_ruby: ".lang-eval-ruby",         selector_reagent: ".lang-reagent",        selector_google_charts: ".lang-google-chart",        selector_es2017: ".lang-eval-es2017",        selector_jsx: ".lang-eval-jsx",        selector_transpile_jsx: ".lang-transpile-jsx",        selector_render_jsx: ".lang-render-jsx",        selector_react: ".lang-react",        selector_eval_markdown: ".lang-render-markdown",        selector_eval_lambdaway: ".lang-render-lambdaway",        selector_eval_cpp: ".lang-eval-cpp",        selector_eval_html: ".lang-render-html",        selector_sql: ".lang-eval-sql",        selector_brainfuck: "lang-eval-brainfuck",        selector_js: ".lang-transpile-cljs"    }; </script> <script src="https://storage.googleapis.com/app.klipse.tech/plugin/js/klipse_plugin.js"></script>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="section3.2.html" class="navigation navigation-prev " aria-label="Previous page: 第二节 模块化搭建神经网络方法">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="../chapter4/" class="navigation navigation-next " aria-label="Next page: 第四章 全连接网络实践">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"第三节 手写数字识别准确率输出","level":"1.4.3","depth":2,"next":{"title":"第四章 全连接网络实践","level":"1.5","depth":1,"path":"chapter4/README.md","ref":"chapter4/README.md","articles":[{"title":"第一节 输入手写数字图片输出识别结果","level":"1.5.1","depth":2,"path":"chapter4/section4.1.md","ref":"chapter4/section4.1.md","articles":[]},{"title":"第二节 制作数据集","level":"1.5.2","depth":2,"path":"chapter4/section4.2.md","ref":"chapter4/section4.2.md","articles":[]}]},"previous":{"title":"第二节 模块化搭建神经网络方法","level":"1.4.2","depth":2,"path":"chapter3/section3.2.md","ref":"chapter3/section3.2.md","articles":[]},"dir":"ltr"},"config":{"plugins":["katex","expandable-chapters-small","tbfed-pagefooter","alerts","copy-code-button","puml","graph","chart","klipse","donate","simple-page-toc","splitter"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright &copy scottdu 2018","modify_label":"该文件修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"puml":{},"simple-page-toc":{"maxDepth":3,"skipFirstH1":true},"splitter":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"graph":{},"donate":{"alipay":"http://ovhbzkbox.bkt.clouddn.com/2018-08-11-alipay1.jpeg","alipayText":"支付宝打赏","button":"赏","title":"","wechat":"http://ovhbzkbox.bkt.clouddn.com/2018-08-11-wechatpay.png","wechatText":"微信打赏"},"katex":{},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"alerts":{},"expandable-chapters-small":{},"copy-code-button":{},"klipse":{"myConfigKey":"it's the default value"},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"chart":{"type":"c3"}},"theme":"default","author":"scottdu","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Tensorflow学习笔记","language":"zh-hans","gitbook":"3.2.3","description":"记录Tensorflow的学习内容"},"file":{"path":"chapter3/section3.3.md","mtime":"2018-08-18T07:53:44.137Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-09-25T05:55:22.995Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-alerts/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-copy-code-button/toggle.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-donate/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

